package com.simple.crawler.connect;

import com.simple.crawler.utils.ReflectUtils;

public abstract class Connection<Req extends Request, Resp extends Response> {

    protected Req request;

    protected Resp response;

    public abstract Connection validate(Req request) throws Exception;

    public abstract Resp  accept() throws Exception;

    public static Connection create(Class<? extends Connection> c, Object... args) {
        return ReflectUtils.getInstance(c, args);
    }
}
